Skip to content

Conversation

@mcratt
Copy link
Contributor

@mcratt mcratt commented Oct 2, 2025

This API is marked as HB_EXPERIMENTAL_API.

Copy link
Collaborator

@khaledhosny khaledhosny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m a bit reluctant to expose this. See also harfbuzz/harfbuzz#5595.

raise MemoryError()
return hb_subset_input_override_name_table(
self._hb_input, name_id, platform_id, encoding_id, language_id, c_name, str_len
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linux distributions builds want to link to system HarfBuzz which is typically built without experimental APIs, so this call should be wrapped in HB_EXPERIMENTAL_API and raise a NotImplementedError otherwise.

@mcratt
Copy link
Contributor Author

mcratt commented Oct 2, 2025

I understand that HarfBuzz does not provide a direct API to obtain platform_id and encoding_id. However, I found that inp.override_name_table(1, 3, 1, 0x409, str) can be used to modify the name, and this entry exists in the majority of fonts. This happens to be exactly what I need, so I would like to use this API.

If this causes complications for Linux builds, I completely understand and can close this PR.

@behdad
Copy link
Member

behdad commented Oct 2, 2025

If we address harfbuzz/harfbuzz#5595 first, we can graduate the API out of experimental.

@mcratt
Copy link
Contributor Author

mcratt commented Oct 7, 2025

It seems that platform_id, encoding_id, and language_id are mainly used internally in HarfBuzz (see hb-ot-name.h#L127).

Perhaps hb_subset_input_override_name_table could behave more like hb_ot_name_list_names, accepting only name_id and the new name_str. The platform_id, encoding_id, and language_id could remain optional parameters, and if they are not specified, HarfBuzz could internally update or remove all records with the given name_id.

@mcratt mcratt closed this Oct 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants